package com.itheima.Service.Impl;
import com.itheima.Mapper.ClazzMapper;
import com.itheima.Pojo.Clazz;
import com.itheima.Service.ClazzService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ClazzServiceImpl implements ClazzService {

    @Autowired
    private ClazzMapper clazzMapper;

    @Override
    public void addClass(Clazz clazz) {

        clazzMapper.addClass(clazz);
    }

    @Override
    public void updateById(Clazz clazz) {
        clazzMapper.updateById(clazz);
    }

    @Override
    public List getAllClass() {
        List<Clazz> clazzes = clazzMapper.SelectAll();
        return clazzes;
    }

    @Override
    public void deleteById(Integer id) {
        clazzMapper.deleteById(id);
    }
}
